package com.linkivr.model;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;

@Entity
public class T_app {
	
	private int app_id;				//应用程序编号
	private String app_name;		//应用程序名称
	private String app_area;		//所在位置
	private String login_name;		//登陆名
	private String login_passwd;	//登陆密码	
	private T_unit	unit;			//所属单位
	
	@Id
	public int getApp_id() {
		return app_id;
	}
	public void setApp_id(int appId) {
		app_id = appId;
	}
	public String getApp_name() {
		if(app_name==null)
			return "";
		return app_name;
	}
	public void setApp_name(String appName) {
		app_name = appName;
	}
	public String getLogin_name() {
		if(login_name==null)
			return "";
		return login_name;
	}
	public void setLogin_name(String loginName) {
		login_name = loginName;
	}
	public String getLogin_passwd() {
		if(login_passwd==null)
			return "";
		return login_passwd;
	}
	public void setLogin_passwd(String loginPasswd) {
		login_passwd = loginPasswd;
	}
	
	@ManyToOne(fetch=FetchType.EAGER,cascade=CascadeType.ALL)
	@JoinColumn(name = "unit_id")
	public T_unit getUnit() {
		return unit;
	}
	public void setUnit(T_unit unit) {
		this.unit = unit;
	}
	public String getApp_area() {
		return app_area;
	}
	public void setApp_area(String appArea) {
		app_area = appArea;
	}

}

